package cn.edu.sjtu.stap.cfg.builder;

/**
 * Default CFG factory for default CFG builder.
 * 
 * @author William
 * 
 */
public class DefaultCfgBuilderFactory extends ICfgBuilderFactory {
    /**
     * Singleton.
     */
    private static DefaultCfgBuilderFactory instance = null;

    public DefaultCfgBuilderFactory() {
        // Empty.
    }

    /**
     * Get an instance of CFG builder factory. The singleton instance is
     * returned by default.
     * 
     * @return DefaultCfgBuilderFactory an instance of default CFG builder
     *         factory.
     */
    public static DefaultCfgBuilderFactory getInstance() {
        if (instance == null) {
            instance = new DefaultCfgBuilderFactory();
        }
        return instance;
    }

    /**
     * Get the default CFG builder.
     */
    public ICfgBuilder getCfgBuilder() {
        //return DefaultCfgBuilder.getInstance();
        return new DefaultCfgBuilder();
    }
}
